#!/usr/bin/make -f

export DEB_CXXFLAGS_MAINT_APPEND := $(shell dpkg-buildflags --get CPPFLAGS)
export LFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

# Qt5
#export QT_SELECT := qt5

%:
	dh $@ --parallel

override_dh_auto_configure:
	qmake CONFIG+=release

override_dh_auto_install:
	install -D -m 755 QssEditor $(CURDIR)/debian/qsseditor/usr/bin/qsseditor
	strip $(CURDIR)/debian/qsseditor/usr/bin/qsseditor
	install -d -m 755 $(CURDIR)/debian/qsseditor/usr/share/qsseditor/translations
	find ts -name '*.qm' -exec install -m 644 '{}' $(CURDIR)/debian/qsseditor/usr/share/qsseditor/translations/ ';'
	install -D -m 644 icons/qsseditor-16.png $(CURDIR)/debian/qsseditor/usr/share/icons/hicolor/16x16/apps/qsseditor.png
	install -D -m 644 icons/qsseditor-24.png $(CURDIR)/debian/qsseditor/usr/share/icons/hicolor/24x24/apps/qsseditor.png
	install -D -m 644 icons/qsseditor-32.png $(CURDIR)/debian/qsseditor/usr/share/icons/hicolor/32x32/apps/qsseditor.png
	install -D -m 644 icons/qsseditor-48.png $(CURDIR)/debian/qsseditor/usr/share/icons/hicolor/48x48/apps/qsseditor.png
	install -D -m 644 man/qsseditor.1 $(CURDIR)/debian/qsseditor/usr/share/man/man1/qsseditor.1
	install -D -m 644 qsseditor.desktop $(CURDIR)/debian/qsseditor/usr/share/applications/qsseditor.desktop
